package com.auto.autoapp.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.auto.autoapp.ui.task.TaskFragment
import com.auto.autoapp.ui.index.IndexFragment
import com.auto.autoapp.ui.mine.MineFragment

class TabAdapter(
    fragmentActivity: FragmentActivity
) : FragmentStateAdapter(fragmentActivity) {

    private val fragments = listOf(
        IndexFragment.newInstance(),
        TaskFragment.newInstance(),
        MineFragment.newInstance()
    )

    override fun getItemCount(): Int = fragments.size

    override fun createFragment(position: Int): Fragment = fragments[position]

}